package cn.walls1717.service.impl;

import cn.walls1717.domain.Permission;
import cn.walls1717.mapper.PermissionMapper;
import cn.walls1717.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author CJ
 * @date 2020/8/12
 */
@Service
@Transactional(rollbackFor=Exception.class)
public class PermissionServiceImpl implements PermissionService {

    private PermissionMapper permissionMapper;

    @Autowired
    public void setPermissionMapper(PermissionMapper permissionMapper) {
        this.permissionMapper = permissionMapper;
    }

    @Override
    public List<Permission> findAll() throws Exception {
        return permissionMapper.findAll();
    }

    @Override
    public void save(Permission permission) throws Exception {
        permissionMapper.save(permission);
    }
}
